#include "stdafx.h"
#include <serialization/ioParamStructs.h>
#include <serialization/serialization.h>
#include <winsock/winsock_stub.h>

void closesocket_stub (
    __in  std::vector<char>& in_buf,
    __out std::vector<char>& out_buf
    )
{
//RECEIVE()
    Deserialize deserialize (in_buf);
    closesocket_in_inout closesocketIN;
    deserialize (closesocketIN);

    int ret = closesocket (closesocketIN.s_);
//SEND
    closesocket_out_inout closesocketOUT( (ret == 0) ? 0 : WSAGetLastError() );
    
    Serialize(deserialize.get_header(), closesocketOUT, out_buf);
}
